/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package camera;

import com.googlecode.javacv.FrameGrabber;
import com.googlecode.javacv.FrameGrabber.Exception;
import com.googlecode.javacv.VideoInputFrameGrabber;

/**
 *
 * @author Home
 */
public class Discovering implements Runnable {

    private int CameraNo;

    public Discovering(int CameraNo) {
        this.CameraNo = CameraNo;
    }

    public void run() {
        try {
            FrameGrabber grabber = new VideoInputFrameGrabber(CameraNo);
            grabber.start();
            Thread.sleep(1000);
            while (true) {
                try {
                    Initialising.setimfromcam(grabber.grab(), CameraNo);
                } catch (Exception ex) {
                }
            }
        } catch (InterruptedException ex) {
        } catch (Exception ex) {
        }
    }
}
